<html>
<head>
<style>
body{font-size: 10pt;color: black;font-family: Verdana, Helvetica, Arial, sans-serif;background-color: #ffffff}
p{font-size: 10pt;color: black;font-family: Verdana, Helvetica, Arial, sans-serif;}
h2{font-size: 13pt;color: #ff9900;font-family: Verdana, Helvetica, Arial, sans-serif;font-weight: bold;}
h3{color: #ff9900;font-weight: bold;font-size: 11pt;font-family: Arial, sans-serif;}
table{background-color:#f0f0ff;}
td{font-size: 10pt;color: black;font-family: Verdana, Helvetica, Arial, sans-serif;padding:4px;}
pre{padding-right: 7pt;padding-left: 7pt;padding-bottom: 7pt;font: 9pt 'Courier New', Courier, mono;width: 100%;padding-top: 7pt;white-space: pre;background-color: #fbedbb}
code{color: #990000;font-family: 'Courier New', Courier, mono;}
A:link{text-decoration: none}
A:visited{text-decoration: none}
A:active{text-decoration: underline}
A:hover{text-decoration: underline}
A.top:link{font-size:8pt;color:red;font-family:Verdana,Helvetica,Arial,sans-serif;}
A.top:visited{font-size:8pt;color:red;font-family:Verdana,Helvetica,Arial,sans-serif;}
A.top:active{font-size:8pt;color:red;font-family:Verdana,Helvetica,Arial,sans-serif;}
A.top:hoover{font-size:8pt;color:red;font-family:Verdana,Helvetica,Arial,sans-serif;}
</style>
</head>
<body>
<h2>CDiskObject</h2><h3>Overview</h3>
<blockquote>
<b>Purpose</b><br>
<code>CDiskObject</code> encapsulates several high-level file- and directory operations.<br>
<p><b>Description</b><br>
All error handling is managed internally, and the different API-functions return a <code>BOOL</code> to signal success or failure. In case of failure, <code>FALSE</code> returned, the member function <code>GetErrorMessage</code> can be called to get a <code>CString</code> with the error message.<br>
<p><b>Usage</b><br>
The class is used by creating a <code>CDiskObject</code>, and calling the methods of the class. No other setup is necessary. If a <code>CWnd</code>-pointer is submitted to the <code>ctor</code>, <code>CDiskObject</code> will give feedback by calling <code>SetWindowText</code> with, for example, filenames during processing.This means that a <code>CStatic</code> (or other appropriate control) can be set up to display the file currently copied, for example.
<p><a class='top' href='index.html'>[back to the index page]</a>
</blockquote>
<a name='contents'></a><h3>Contents</h3>
<b>- C -</b><br>
<a href='#CDiskObjectCWndfeedbackWindow'>CDiskObject( CWnd* feedbackWindow )</a><br>
<a href='#CDiskObject'>CDiskObject()</a><br>
<a href='#ClearError'>ClearError( )</a><br>
<a href='#CopyDirectoriesconstCStringsourceDirectoryconstCStringdestDirectory'>CopyDirectories( const CString& sourceDirectory,const CString& destDirectory )</a><br>
<a href='#CopyDirectoryconstCStringsourceDirectoryconstCStringdestDirectory'>CopyDirectory( const CString& sourceDirectory,const CString& destDirectory )</a><br>
<a href='#CopyFileconstCStringsourceFileconstCStringdestDirectory'>CopyFile( const CString& sourceFile,const CString& destDirectory )</a><br>
<a href='#CopyFileconstCStringsourceFileconstCStringdestDirectoryconstCStringdestFile'>CopyFile( const CString& sourceFile,const CString& destDirectory, const CString& destFile )</a><br>
<a href='#CopyFilesCStringArrayfilesconstCStringdestDirectory'>CopyFiles( CStringArray& files,const CString& destDirectory )</a><br>
<a href='#CopyFilesconstCStringsourceDirectoryconstCStringdestDirectory'>CopyFiles( const CString& sourceDirectory,const CString& destDirectory )</a><br>
<a href='#CreateDirectoryconstCStringdirectory'>CreateDirectory( const CString& directory )</a><br>
<a href='#CreateFileconstCStringfile'>CreateFile( const CString& file )</a><br>
<p>
<b>- D -</b><br>
<a href='#DirectoryExistsconstCStringdirectory'>DirectoryExists( const CString& directory )</a><br>
<p>
<b>- E -</b><br>
<a href='#EmptyDirectoriesconstCStringdirectory'>EmptyDirectories( const CString& directory )</a><br>
<a href='#EmptyDirectoryconstCStringdirectory'>EmptyDirectory( const CString& directory )</a><br>
<a href='#EnumAllDirectoriesconstCStringsourceDirectoryCStringArraydirectories'>EnumAllDirectories( const CString& sourceDirectory, CStringArray& directories )</a><br>
<a href='#EnumAllFilesconstCStringsourceDirectoryCStringArrayfiles'>EnumAllFiles( const CString& sourceDirectory, CStringArray& files )</a><br>
<a href='#EnumAllFilesWithFilterconstCStringfilterconstCStringsourceDirectoryCStringArrayfiles'>EnumAllFilesWithFilter( const CString& filter,const CString& sourceDirectory, CStringArray& files )</a><br>
<a href='#EnumDirectoriesconstCStringsourceDirectoryCStringArraydirectories'>EnumDirectories( const CString& sourceDirectory, CStringArray& directories )</a><br>
<a href='#EnumFilesInDirectoryconstCStringsourceDirectoryCStringArrayfilesintmode'>EnumFilesInDirectory( const CString& sourceDirectory, CStringArray& files, int mode )</a><br>
<a href='#EnumFilesInDirectoryWithFilterconstCStringstrFilterconstCStringsourceDirectoryCStringArrayfilesintmode'>EnumFilesInDirectoryWithFilter( const CString& strFilter,const CString& sourceDirectory, CStringArray& files, int mode )</a><br>
<p>
<b>- F -</b><br>
<a href='#FileExistsconstCStringfile'>FileExists( const CString& file )</a><br>
<a href='#FileInformationconstCStringfileBY_HANDLE_FILE_INFORMATIONfile_info'>FileInformation( const CString& file, BY_HANDLE_FILE_INFORMATION &file_info )</a><br>
<p>
<b>- G -</b><br>
<a href='#GetDirectoryNameconstCStringstr'>GetDirectoryName( const CString& str )</a><br>
<a href='#GetErrorMessage'>GetErrorMessage( )</a><br>
<a href='#GetFileNameconstCStringstr'>GetFileName( const CString& str )</a><br>
<p>
<b>- M -</b><br>
<a href='#MoveFileconstCStringsourceFileconstCStringdestFile'>MoveFile( const CString& sourceFile, const CString& destFile )</a><br>
<p>
<b>- Q -</b><br>
<a href='#QualifyFileCStringstr'>QualifyFile( CString& str )</a><br>
<a href='#QualifyPathCStringstr'>QualifyPath( CString& str )</a><br>
<p>
<b>- R -</b><br>
<a href='#RemoveDirectoriesconstCStringdirectory'>RemoveDirectories( const CString& directory )</a><br>
<a href='#RemoveDirectoryconstCStringdirectory'>RemoveDirectory( const CString& directory )</a><br>
<a href='#RemoveFileconstCStringsourceFile'>RemoveFile( const CString& sourceFile )</a><br>
<a href='#RenameFileconstCStringsourceFileconstCStringdestFile'>RenameFile( const CString& sourceFile, const CString& destFile )</a><br>
<p>
<b>- S -</b><br>
<a href='#SetInternalErrorMessage'>SetInternalErrorMessage( )</a><br>
<a href='#SetSystemErrorMessageinterrorconstCStringelements'>SetSystemErrorMessage( int error,const CString& elements)</a><br>
<p>
<b>- ~ -</b><br>
<a href='#~CDiskObject'>~CDiskObject( )</a><br>
<p><h3>Functions</h3><hr>
<code><b><a name='CDiskObjectCWndfeedbackWindow'></a>CDiskObject( CWnd* feedbackWindow )</b></code>
<blockquote>
<b>Description</b><br>
Constructor
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CWnd* hwndFeedback </code> -  <code>CWnd</code> to feedback window<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Should normally be created on the stack.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='CDiskObject'></a>CDiskObject()</b></code>
<blockquote>
<b>Description</b><br>
Constructor
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Should normally be created on the stack.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='ClearError'></a>void ClearError( )</b></code>
<blockquote>
<b>Description</b><br>
Clears the internal error message string
<br><b>Access</b><br>
Private
<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Call to clear the internal error message.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='CopyDirectoriesconstCStringsourceDirectoryconstCStringdestDirectory'></a>BOOL CopyDirectories( const CString& sourceDirectory,const CString& destDirectory )</b></code>
<blockquote>
<b>Description</b><br>
Copies all the files and subdirectories from <code>sourceDirectory</code> to <code>destDirectory</code>, keeping the directory structure. Existing files will be overwritten. <code>destDirectory</code> and subdirectories will be created if necessary.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString sourceDirectory </code> -  copy from.<br><code>CString destDirectory </code> -  copy to.<br>
<b>Returns</b><br>
<code>BOOL     </code> -  <code>TRUE</code> if OK. <code>GetErrorMessage</code> will get an error string if <code>FALSE</code>
<br><br><b>Usage</b><br>
Call to copy a directory tree to a new directory tree.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='CopyDirectoryconstCStringsourceDirectoryconstCStringdestDirectory'></a>BOOL CopyDirectory( const CString& sourceDirectory,const CString& destDirectory )</b></code>
<blockquote>
<b>Description</b><br>
Copies all the files from <code>sourceDirectory</code> to <code>destDirectory</code>. Existing files will be overwritten. <code>destDirectory</code> will be created if necessary. Subdirectories will not be copied.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString sourceDirectory </code> -  copy from.<br><code>CString destDirectory </code> -  copy to.<br>
<b>Returns</b><br>
<code>BOOL     </code> -  <code>TRUE</code> if OK. <code>GetErrorMessage</code> will get an error string if <code>FALSE</code>
<br><br><b>Usage</b><br>
Call to copy a directory to another directory.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='CopyFileconstCStringsourceFileconstCStringdestDirectory'></a>BOOL CopyFile( const CString& sourceFile,const CString& destDirectory )</b></code>
<blockquote>
<b>Description</b><br>
Will copy <code>sourceFile</code> to <code>destDirectory</code>. An existing file will be overwritten. The directory will be created if it doesn't exist.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString sourceFile  </code> -  file to copy<br><code>CString destDirectory </code> -  destination<br>
<b>Returns</b><br>
<code>BOOL     </code> -  <code>TRUE</code> if OK. <code>GetErrorMessage</code> will contain errors
<br><br><b>Usage</b><br>
Call to copy a file to a directory.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='CopyFileconstCStringsourceFileconstCStringdestDirectoryconstCStringdestFile'></a>BOOL CopyFile( const CString& sourceFile,const CString& destDirectory, const CString& destFile )</b></code>
<blockquote>
<b>Description</b><br>
Will copy <code>sourceFile</code> to <code>destDirectory</code> with the new name <code>destFile</code>. An existing file will be overwritten. The directory will be created if it doesn't exist.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString sourceFile  </code> -  file to copy<br><code>CString destDirectory </code> -  destination<br><code>CString destFile  </code> -  destination file name (in <code>destDirectory</code>)<br>
<b>Returns</b><br>
<code>BOOL     </code> -  <code>TRUE</code> if OK. <code>GetErrorMessage</code> will contain errors
<br><br><b>Usage</b><br>
Call to copy a file to a directory.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='CopyFilesCStringArrayfilesconstCStringdestDirectory'></a>BOOL CopyFiles( CStringArray& files,const CString& destDirectory )</b></code>
<blockquote>
<b>Description</b><br>
The function copies the files in the <code>CStringArray</code> <code>files</code> to the directory <code>destDirectory</code>. Existing files will be overwritten. The destination will be created if it doesn't already exist.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CStringArray& files  </code> -  a string array with the files to copy<br><code>CString destDirectory </code> -  destination<br>
<b>Returns</b><br>
<code>BOOL     </code> -  <code>TRUE</code> if OK. <code>GetErrorMessage</code> will return errors.
<br><br><b>Usage</b><br>
Copy a list of files to a directory.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='CopyFilesconstCStringsourceDirectoryconstCStringdestDirectory'></a>BOOL CopyFiles( const CString& sourceDirectory,const CString& destDirectory )</b></code>
<blockquote>
<b>Description</b><br>
The member copies all files from <code>sourceDirectory</code> to <code>destDirectory</code>. Subdirectories will not be copied.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString sourceDirectory </code> -  Copy from. If empty, current.<br><code>CString destDirectory </code> -  Copy to. If empty, current.<br>
<b>Returns</b><br>
<code>BOOL     </code> -  <code>TRUE</code> if OK. <code>GetErrorMessage</code> will return errors.
<br><br><b>Usage</b><br>
Call to copy the files from one directory to another.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='CreateDirectoryconstCStringdirectory'></a>BOOL CreateDirectory( const CString& directory )</b></code>
<blockquote>
<b>Description</b><br>
Will recursively create the directory <code>directory</code>.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString directory </code> -  directory to create<br>
<b>Returns</b><br>
<code>BOOL    </code> -  <code>TRUE</code> if OK. <code>GetErrorMessage</code> will get an error string if <code>FALSE</code>
<br><br><b>Usage</b><br>
Call to create a directory chain.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='CreateFileconstCStringfile'></a>BOOL CreateFile( const CString& file )</b></code>
<blockquote>
<b>Description</b><br>
Creates the file <code>file</code>, as well as the directories necessary
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString file </code> -  file to create<br>
<b>Returns</b><br>
<code>BOOL   </code> -  <code>TRUE</code> if OK
<br><br><b>Usage</b><br>
Call to create a file.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='DirectoryExistsconstCStringdirectory'></a>BOOL DirectoryExists( const CString& directory )</b></code>
<blockquote>
<b>Description</b><br>
Returns <code>TRUE</code> if the directory <code>directory</code> exists
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString directory </code> -  directory to check<br>
<b>Returns</b><br>
<code>BOOL    </code> -  <code>TRUE</code> if found
<br><br><b>Usage</b><br>
Call to check for directory existence.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='EmptyDirectoriesconstCStringdirectory'></a>BOOL EmptyDirectories( const CString& directory )</b></code>
<blockquote>
<b>Description</b><br>
Will delete all files in <code>directory</code>. Will also empty subdirectories.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString directory </code> -  the root directory to empty.<br>
<b>Returns</b><br>
<code>BOOL    </code> -  <code>TRUE</code> if OK. <code>GetErrorMessage</code> will get an error string if <code>FALSE</code>
<br><br><b>Usage</b><br>
Call to empty a directory tree.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='EmptyDirectoryconstCStringdirectory'></a>BOOL EmptyDirectory( const CString& directory )</b></code>
<blockquote>
<b>Description</b><br>
Will delete all files in directory.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString directory </code> -  the directory to empty.<br>
<b>Returns</b><br>
<code>BOOL    </code> -  <code>TRUE</code> if OK. <code>GetErrorMessage</code> will get an error string if <code>FALSE</code>
<br><br><b>Usage</b><br>
Call to empty a directory.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='EnumAllDirectoriesconstCStringsourceDirectoryCStringArraydirectories'></a>BOOL EnumAllDirectories( const CString& sourceDirectory, CStringArray& directories )</b></code>
<blockquote>
<b>Description</b><br>
Enumerates all directories recursively in directory <code>sourceDirectory</code>, and adds them to the <code>CStringArray</code> <code>directories</code>. Each entry will be a fully qualified name
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString sourceDirectory  </code> -  start directory<br><code>CStringArray& directories </code> -  <code>CStringArray</code> to be filled with the directory names.<br>
<b>Returns</b><br>
<code>BOOL      </code> -  <code>TRUE</code> if OK. <code>GetErrorMessage</code> will contain errors
<br><br><b>Usage</b><br>
Call to get the directory names in a directory tree.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='EnumAllFilesconstCStringsourceDirectoryCStringArrayfiles'></a>BOOL EnumAllFiles( const CString& sourceDirectory, CStringArray& files )</b></code>
<blockquote>
<b>Description</b><br>
Returns, recursively, the fully qualified names of all files found under <code>sourceDirectory</code>.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString sourceDirectory </code> -  Root dir<br><code>CStringArray& files  </code> -  output list of all files found<br>
<b>Returns</b><br>
<code>BOOL     </code> -  <code>TRUE</code> if OK.
<br><br><b>Usage</b><br>
Call to get the names of all files in a directory tree.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='EnumAllFilesWithFilterconstCStringfilterconstCStringsourceDirectoryCStringArrayfiles'></a>BOOL EnumAllFilesWithFilter( const CString& filter,const CString& sourceDirectory, CStringArray& files )</b></code>
<blockquote>
<b>Description</b><br>
Returns, recursively, the fully qualified names of all files matching the filter found under <code>sourceDirectory</code>.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString filter   </code> -  Filter for files to find<br><code>CString sourceDirectory </code> -  Root dir<br><code>CStringArray& files  </code> -  output list of all files found<br>
<b>Returns</b><br>
<code>BOOL     </code> -  <code>TRUE</code> if OK.
<br><br><b>Usage</b><br>
Call to get a filtered list of all files in a directory tree.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='EnumDirectoriesconstCStringsourceDirectoryCStringArraydirectories'></a>BOOL EnumDirectories( const CString& sourceDirectory, CStringArray& directories )</b></code>
<blockquote>
<b>Description</b><br>
Enumerates all directories in directory <code>sourceDirectory</code>, and adds them to the <code>CStringArray</code> <code>directories</code>. Each entry will be a fully qualified name
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString sourceDirectory  </code> -  start directory<br><code>CStringArray& directories </code> -  <code>CStringArray</code> to be filled with the directory names.<br>
<b>Returns</b><br>
<code>BOOL      </code> -  <code>TRUE</code> if OK. <code>GetErrorMessage</code> will contain errors
<br><br><b>Usage</b><br>
Call to get a list of directories in a directory tree.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='EnumFilesInDirectoryconstCStringsourceDirectoryCStringArrayfilesintmode'></a>BOOL EnumFilesInDirectory( const CString& sourceDirectory, CStringArray& files, int mode )</b></code>
<blockquote>
<b>Description</b><br>
Enumerates all files in directory <code>sourceDirectory</code>, and adds them to the <code>CStringArray</code> <code>files</code>. Will not add subdirectories
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString sourceDirectory </code> -  The directory to enumerate<br><code>CStringArray& files  </code> -  The resulting files<br>
<b>Returns</b><br>
<code>BOOL     </code> -  <code>TRUE</code> if OK. <code>GetErrorMessage</code> will contain errors
<br><br><b>Usage</b><br>
Call to get a list of files in a directory.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='EnumFilesInDirectoryWithFilterconstCStringstrFilterconstCStringsourceDirectoryCStringArrayfilesintmode'></a>BOOL EnumFilesInDirectoryWithFilter( const CString& strFilter,const CString& sourceDirectory, CStringArray& files, int mode )</b></code>
<blockquote>
<b>Description</b><br>
Enumerates all files matching <code>strFilter</code> in the directory <code>sourceDirectory</code>, and adds them to the <code>CStringArray</code> <code>files</code>. Will not add subdirectories.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString strFilter  </code> -  the file name filter<br><code>CString sourceDirectory </code> -  source directory<br><code>CStringArray& files  </code> -  output array<br>
<b>Returns</b><br>
<code>BOOL     </code> -  <code>TRUE</code> if OK. <code>GetErrorMessage</code> will contain errors
<br><br><b>Usage</b><br>
Call to get a filtered list of files from a directory.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='FileExistsconstCStringfile'></a>BOOL FileExists( const CString& file )</b></code>
<blockquote>
<b>Description</b><br>
Returns <code>TRUE</code> if the file file exists
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString file </code> -  file to check<br>
<b>Returns</b><br>
<code>BOOL   </code> -  <code>TRUE</code> if found
<br><br><b>Usage</b><br>
Call to check for file existence.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='FileInformationconstCStringfileBY_HANDLE_FILE_INFORMATIONfile_info'></a>BOOL FileInformation( const CString& file, BY_HANDLE_FILE_INFORMATION &file_info )</b></code>
<blockquote>
<b>Description</b><br>
Returns <code>TRUE</code> if the file file exists At this time file_info is filled out
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString file       </code> -  file to check<br><code>BY_HANDLE_FILE_INFORMATION &file_info </code> -  info filled out<br>
<b>Returns</b><br>
<code>BOOL         </code> -  <code>TRUE</code> if found
<br><br><b>Usage</b><br>
Call to check for file existence and if there return data about that file.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='GetDirectoryNameconstCStringstr'></a>CString GetDirectoryName( const CString& str )</b></code>
<blockquote>
<b>Description</b><br>
Returns the directory name part of <code>str</code>
<br><b>Access</b><br>
Private
<br><br><b>Parameters</b><br>
<code>CString str </code> -  The complete name to check<br>
<b>Returns</b><br>
<code>CString </code> - 
<br><br><b>Usage</b><br>
Call to get the directory from a fully qualified path.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='GetErrorMessage'></a>CString GetErrorMessage( )</b></code>
<blockquote>
<b>Description</b><br>
Will return the current error message for the <code>CDiskObject</code>.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
<code>CString </code> -  current error message.
<br><br><b>Usage</b><br>
Call to get the error message.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='GetFileNameconstCStringstr'></a>CString GetFileName( const CString& str )</b></code>
<blockquote>
<b>Description</b><br>
Returns the file name part of <code>str</code>.
<br><b>Access</b><br>
Private
<br><br><b>Parameters</b><br>
<code>CString str </code> -  The complete name to get<br>
<b>Returns</b><br>
<code>CString </code> - 
<br><br><b>Usage</b><br>
Call to get the filename from a fully qualified path.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='MoveFileconstCStringsourceFileconstCStringdestFile'></a>BOOL MoveFile( const CString& sourceFile, const CString& destFile )</b></code>
<blockquote>
<b>Description</b><br>
Move the file <code>sourceFile</code> to <code>destFile</code>. Creates the destination directory if necessary
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>const CString& sourceFile </code> -  File to move<br><code>const CString& desFile  </code> -  New name/location<br>
<b>Returns</b><br>
<code>BOOL      </code> -  <code>TRUE</code> if renamed OK
<br><br><b>Usage</b><br>
Call to move a file.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='QualifyFileCStringstr'></a>void QualifyFile( CString& str )</b></code>
<blockquote>
<b>Description</b><br>
Creates a fully qualified path from <code>str</code>.
<br><b>Access</b><br>
Private
<br><br><b>Parameters</b><br>
<code>CString& str </code> -  the filename to qualify<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Call to create a fully qualified filename.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='QualifyPathCStringstr'></a>void QualifyPath( CString& str )</b></code>
<blockquote>
<b>Description</b><br>
Creates a fully qualified path from <code>str</code>.
<br><b>Access</b><br>
Private
<br><br><b>Parameters</b><br>
<code>CString& str </code> -  the path to qualify<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Call to create a fully qualified path.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='RemoveDirectoriesconstCStringdirectory'></a>BOOL RemoveDirectories( const CString& directory )</b></code>
<blockquote>
<b>Description</b><br>
Will remove the directory <code>directory</code>, even if not empty. Will remove subdirectories.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString directory </code> -  root directory to remove.<br>
<b>Returns</b><br>
<code>BOOL    </code> -  <code>TRUE</code> if OK. <code>GetErrorMessage</code> will get an error string if <code>FALSE</code>
<br><br><b>Usage</b><br>
Call to remove a directory tree.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='RemoveDirectoryconstCStringdirectory'></a>BOOL RemoveDirectory( const CString& directory )</b></code>
<blockquote>
<b>Description</b><br>
Will remove the directory <code>directory</code>, even if not empty. Will not remove subdirectories.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CString directory </code> -  directory to remove.<br>
<b>Returns</b><br>
<code>BOOL    </code> -  <code>TRUE</code> if OK. <code>GetErrorMessage</code> will get an error string if <code>FALSE</code>
<br><br><b>Usage</b><br>
Call to remove a directory.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='RemoveFileconstCStringsourceFile'></a>BOOL RemoveFile( const CString& sourceFile )</b></code>
<blockquote>
<b>Description</b><br>
Will remove <code>sourceFile</code>.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>const CString& sourceFile </code> -  File to remove<br>
<b>Returns</b><br>
<code>BOOL      </code> -  <code>TRUE</code> if removed ok
<br><br><b>Usage</b><br>
Call to delete a file. Added for reasons of symmetry.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='RenameFileconstCStringsourceFileconstCStringdestFile'></a>BOOL RenameFile( const CString& sourceFile, const CString& destFile )</b></code>
<blockquote>
<b>Description</b><br>
Renames the file <code>sourceFile</code> to <code>destFile</code>. <code>destFile</code> is assumed to be a filename rather than a fully qualified path.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>const CString& sourceFile </code> -  file to rename<br><code>const CString& desFile  </code> -  New name<br>
<b>Returns</b><br>
<code>BOOL      </code> -  <code>TRUE</code> if renamed OK
<br><br><b>Usage</b><br>
Call to rename a file.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='SetInternalErrorMessage'></a>void SetInternalErrorMessage( )</b></code>
<blockquote>
<b>Description</b><br>
Sets the error message to the internal error message
<br><b>Access</b><br>
Private
<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Call to set the error message.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='SetSystemErrorMessageinterrorconstCStringelements'></a>void SetSystemErrorMessage( int error,const CString& elements)</b></code>
<blockquote>
<b>Description</b><br>
Sets the error message string with the system error message as gotten from <code>GetLastError</code>. <code>elements</code> will be appended.
<br><b>Access</b><br>
Private
<br><br><b>Parameters</b><br>
<code>int error   </code> -  error number from <code>GetLastError</code><br><code>CString elements </code> -  files or directories to add to the message<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Call to set the error message.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
<code><b><a name='~CDiskObject'></a>~CDiskObject( )</b></code>
<blockquote>
<b>Description</b><br>
Destructor
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Should normally be created on the stack.<p>
<a class='top' href='#contents'>[back to the contents]</a>
</blockquote>
<hr>
</body>
</html>
